<?php
use yii\helpers\Url;
?>
<!--<link href="libs/video.js/5.0.2/video-js.css" rel="stylesheet">
<script src="libs/video.js/5.0.2/videojs-ie8.min.js"></script>
<script src="libs/video.js/5.0.2/video.js"></script>-->
<?php $this->registerCssFile("@web/libs/video.js/5.0.2/video-js.css");?>


<style>
    html,body{margin: 0;padding: 0;width: 100%;height: 100%;}
    #video{width: 100%;height: 100%;}
    video::-webkit-media-controls {
        display:none !important;
    }
</style>

<video id="video" class="video-js vjs-default-skin" autoplay preload="none"  poster="<?= Yii::getAlias('@web/source/start.jpg') ?>" data-setup="{}">
    <source src="<?= Yii::getAlias('@web/source/V3.webm') ?>" type="video/webm">
    <source src="<?= Yii::getAlias('@web/source/V3.ogv') ?>" type="video/ogg">
    <source src="<?= Yii::getAlias('@web/source/V3.mp4') ?>" type="video/mp4">
    你的浏览器不支持video标签，请升级浏览器。
</video>

<?php $this->registerJsFile("@web/libs/video.js/5.0.2/videojs-ie8.min.js",['position'=>$this::POS_END]);?>
<?php $this->registerJsFile("@web/libs/video.js/5.0.2/video.js",['position'=>$this::POS_END]);?>


<?php $this->beginBlock('js_index_end') ?>
var height=window.screen.availHeight;
var width=window.screen.availWidth;

window.top.resizeTo(width, height);
$(function(){
var player = videojs('video');
player.on('timeupdate', function () {
if (player.duration() != 0 && player.currentTime() === player.duration()) {
window.location.href= "<?= Url::to(['index']) ?>"
}
});
$('body').click(function(){
window.location.href= "<?= Url::to(['index']) ?>"
})
})

<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js_index_end'], $this::POS_END); ?>
